Skip to content

Fernando-CR19/kronos-api

Repository files navigation

Nest Logo

Kronos API — Backend of the Kronos personal calendar app, built with NestJS + PostgreSQL.

NPM Version Package License

Description

REST API for the Kronos mobile app — a personal calendar with offline-first sync, color tags, and local notifications. Built with NestJS, Prisma, and PostgreSQL.

Requirements

Getting started

1. Install dependencies

$ yarn install

2. Configure environment variables

$ cp .env.example .env

Open .env and fill in the variables:

DB_USER=your_user
DB_PASSWORD=your_password
DB_NAME=mnemo

DATABASE_URL=postgresql://your_user:your_password@localhost:5434/mnemo?schema=public

ADM_EMAIL=your_admin_email
ADM_PASS=your_admin_password

3. Start the database

# First time — create and start the container
$ docker compose up -d

# After the first time — just start
$ yarn db:start

4. Run database migrations

$ yarn prisma migrate deploy

5. Generate Prisma client

$ yarn prisma generate

6. Run the seed

$ yarn seed

7. Start the API

# Development
$ yarn start:dev

# Production
$ yarn start:prod

The API will be available at http://localhost:3000.

Database commands

# Start the database container
$ yarn db:start

# Stop the database container
$ yarn db:stop

# Reset the database (WARNING: deletes all data)
$ yarn db:reset

Prisma commands

# Generate Prisma client
$ yarn prisma generate

# Create a new migration
$ yarn prisma migrate dev --name your_migration_name

# Apply pending migrations
$ yarn prisma migrate deploy

Compile and run

# Development (watch mode)
$ yarn start:dev

# Debug mode
$ yarn start:debug

# Production
$ yarn start:prod

Run tests

# Unit tests
$ yarn test

# E2E tests
$ yarn test:e2e

# Test coverage
$ yarn test:cov

Resources

License

MIT licensed.

About

Kronos · Flutter + NestJS · Personal calendar app with offline-first sync, color tags and local notifications · Api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors