This project is a fullstack application consisting of a frontend built with Vite (TypeScript) and a backend built with Node.js (TypeScript). The frontend is built and served by the backend after compiling. This guide will walk you through setting up the project manually and using Docker.
Ensure that you have the following installed:
- Node.js (version 20 or above)
- Docker
- Docker Compose
Follow these steps to run the application manually:
-
Clone the repository to your local machine.
git clone https://github.com/wikigreen/alias-express.git cd alias-express
-
Install the dependencies for the root project, backend, and frontend:
npm install npm install --prefix backend npm install --prefix frontend
To compile both the frontend and backend, run the following command from the root project directory:
npm run buildThis will:
- Build the frontend using Vite (it will compile TypeScript files and bundle assets).
- Build the backend TypeScript files using
tsc.
Once the build process is complete, start the backend by running:
node ./dist/index.jsYour backend will now be running and accessible at http://localhost:3000 (or the port specified in your environment variables).
If you want to use different environment variables (e.g., for Redis), you can configure them in your .env file or specify them directly in the terminal when running the application.
This project includes a Dockerfile and docker-compose.yml for running the application in Docker containers.
-
Ensure you have Docker and Docker Compose installed on your machine.
-
Build and start the Docker containers by running the following command from the root directory of your project:
docker-compose up --build