Skip to content

sesolabor/seso-interview-prep-repo

Repository files navigation

Seso Labor Application

The Seso-app repo supports Seso Labor's web server, client application, and other services.

Installation

  1. Clone the repository:
    $ git clone [email protected]:sesolabor/seso-interview-prep-repo.git
    
  2. Install dependencies:
    $ npm install
    
  3. Start database services:
    $ docker-compose up
    
  4. If your first time, initialize local database:
    $ npm run db:init
    
    Note: if you see 'error : database "seso" does not exist', it may be due to an existing Postgres process running on port 5432. To fix this, stop your running containers and then see if any processes are listed when you run:
    $ sudo lsof -i :5432
    
    If so, remove them (brew services stop postgresql or kill -9 <PID>) and then run the migration again
    $ db:migration:run
    

Running the app

  1. Start the application:
    $ npm run dev
    
  2. Navigate: http://localhost:3000

Project Structure

The project follows the spirit of Domain Driven Design. Top-level nouns being: Entities, Repositories, and Services.

Project Structure

├── server.ts # Routes and bootup stuff.
│
├── pages # Handlers.
│
├── services # Business logic.
│
├── repositories # Repositories & Entities. Think 'single responsibility'.
│
├── client-state # Redux tooling, sagas, ducks.
│
├── components # React components.

Migrations

Entities are TypeORM Entities. Creating/updating entities, requires migrations! To generate and run migrations, follow these steps:

  1. Generating a new entity:

    $ npm run typeorm -- entity:create -n User
    
    > [email protected] typeorm /Users/wiski/projects/seso-app
    > ts-node ./node_modules/typeorm/cli --config repositories/ormconfig.ts "entity:create" "-n" "User"
    
    Entity /Users/wiski/projects/seso-app/repositories/entities/User.ts has been created successfully.
    
  2. Adding/changing attributes to the entity.

  3. Generating a new migration:

    $ npm run typeorm -- migration:generate -n CreateUser
    
  4. Running the resulting migration:

    $ npm run typeorm -- migration:run
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published