This repository contains the source code of a website containing a game for guessing a baby's time of birth created using the Remix framework.
The following prerequisites are needed to successfully launch this project locally:
-
Yarn or similar
-
Docker - for running a local PostgreSQL container (optional)
-
Postman - for interacting with the API (optional)
- A hosted PostgreSQL database for storing guesses and user data, if not using Docker.
- The schema.sql file contains the database migrations for setting up a PostgreSQL database.
In order to provide a login functionality, any eligible participant has to be manually entered into the database upfront.
A single user may be added using the following SQL statement:
INSERT INTO users (name) VALUES ('John Doe');
Multiple users may be added at once using a .csv
file in the following format:
name
Jane Doe
John Doe
Afterwards, the following SQL statement may be used to import the users from the .csv
file:
COPY users (name)
FROM 'the-csv-file.csv'
DELIMITER ',' CSV HEADER;
-
Copy
.env.sample
to.env
and populate the environment variablescp .env.sample .env
-
Install dependencies
yarn # or npm install
-
Run the build
yarn build # or npm run build
-
Run the local server
yarn start # or npm start
--- OR ---
-
Run development preview
yarn dev # or npm run dev
-
A Netlify account
- Remix supports other integrations as well. Check out the Remix website for getting to know how to switch to another hosting provider.
-
Access to GitHub Actions for benefitting from an automated deployment integration (optional)
- If used, environment variables listed in
.env.sample
need to be set in the repository settings at GitHub accordingly.
- If used, environment variables listed in
-
A hosted PostgreSQL database for storing guesses and user data.
- The schema.sql file contains the database migrations for setting up a PostgreSQL database.
Licensed under the MIT license.
Copyright ©️ 2024 Sascha Zarhuber