This guide provides instructions on how to set up and test the application both locally and using Docker. Follow these steps to ensure your development environment is correctly configured.
Ensure you have node
>18 yarn
installed on your system, which you can get from Yarn's official website.
Before running the application, install the necessary dependencies:
yarn install
cd be && ./scripts/createEnvs.sh && cd ..
To populate the database with initial data, run the seeding script:
yarn run seed
Start the client-side application with the following command:
yarn run dev:fe
To build run
To build and run the backend server locally (outside of Docker), use:
yarn workspace be build
yarn run dev:be
You can also run the server side within Docker, which includes three main services: backend
, mongo
, and mongorestore
.
- server: This service runs the backend application.
- mongo: This service manages the MongoDB database.
- mongorestore: This service is responsible for restoring the database from a dump.
To start all services, execute:
docker-compose up --build
Currently, the application's tests are not configured to work with the TypeScript setup due to incomplete Jest configuration. The tests need proper integration with the tsconfig
settings.
- Client-Side Configuration: The frontend part of the project was not fully configured. Specifically, Tailwind CSS was not set up, and it’s unclear if this was intentional. I've made necessary adjustments to ensure the project works by adding Tailwind CSS configs.
- Project Structure: This project uses Yarn workspaces for managing multiple packages, which is not supported by npm. This decision necessitated adjustments in several configuration settings to make the project compatible with Yarn.
- Other thoughts: While working on this projects I reflected on why I didn't use a template for this Express, MongoDB, and TypeScript project from the start, it would be so less work to do.