This codebase contains all the necessary code to operate the eser.live website. Since there's no hidden parts -excluding some API keys- and it's completely open-source, it simply allows you to modify it or run your own website by following the instructions below.
Additionally, this repository serves as a template for a full-stack web application built with Deno Fresh and Tailwind CSS.
Before starting, you'll need:
To get started:
git clone https://github.com/eser/eser.live.git
cd eser.live
.env
file:
POSTGRES_CONNSTR=postgres://postgres:s3cr3t@0.0.0.0:5432/postgres
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
YOUTUBE_API_KEY=
ACME, Inc
.http://localhost:8000
.http://localhost:8000/auth/callback
..env
file:
GITHUB_CLIENT_ID=<GitHub OAuth application client ID>
.env
file on a new line:
GITHUB_CLIENT_SECRET=<GitHub OAuth application client secret>
deno task start
http://localhost:8000
to start playing with the app.Use the following commands to work with your local database:
deno task db:migrate
- Populate the database with data.deno task db:reset
- Reset the database. This is not recoverable.The ./pkg/main/constants.ts file includes global values used across various aspects of the codebase. Update these values according to your needs.
You can create and customize styles within the capabilities of Tailwind CSS and Daisy UI. Tailwind configuration can be found at ./pkg/main/tailwind.config.ts.
This section assumes that a local development environment is already set up.
https://eser.live
./auth/callback
path. E.g.
https://eser.live/auth/callback
..env
file to your production environment.main.ts
as the entry point.You should now be able to visit your newly deployed SaaS.
Docker makes it easy to deploy and run your Deno app to any virtual private server (VPS). This section will show you how to do that with AWS Lightsail and Digital Ocean.
docker
CLI.Note: the
Dockerfile
,.dockerignore
anddocker-compose.yml
files come included with this repo.
# get the SHA1 commit hash of the current branch
git rev-parse HEAD
Copy the output of the above and paste it as DENO_DEPLOYMENT_ID
in your .env file. This value is needed to enable
caching on Fresh in a Docker deployment.
Finally, refer to these guides for using Docker to deploy Deno to specific platforms:
GET /qa/
Get all questions in chronological order. Add ?cursor=<cursor>
URL parameter for pagination. Limited to 10 questions
per page.
Example 1:
// https://eser.live/qa/
{
"items": [
// 9 more items...
{
"id": "01HRRK8DNTDEX83265MX9G2MHD",
"userLogin": "eser",
"question": "Test sorusu",
"score": 1,
"hidden": false
}
],
"cursor": "01HRRK8DNTDEX83265MX9G2MHD"
}
Example 2 (using cursor
field from page 1):
// https://eser.live/qa/?cursor=01HRRK8DNTDEX83265MX9G2MHD
{
"items": [
// 7 more items...
],
"cursor": ""
}
GET /qa/:id/
Get the question with the given ID.
Example:
// https://eser.live/qa/01HRRK8DNTDEX83265MX9G2MHD/
{
"id": "01HRRK8DNTDEX83265MX9G2MHD",
"userLogin": "eser",
"question": "Test sorusu",
"score": 1,
"hidden": false
}
GET /users/
Get all users in alphabetical order by GitHub login. Add ?cursor=<cursor>
URL parameter for pagination. Limited to 10
users per page.
Example:
// https://eser.live/users/
{
"items": [
{
"login": "eser",
"sessionId": "1b10cfe8-25c4-4d77-b999-0602fa1760cc"
}
],
"cursor": ""
}
GET /users/:login/
Get the user with the given GitHub login.
Example:
// https://eser.live/users/eser/
{
"login": "eser",
"sessionId": "1b10cfe8-25c4-4d77-b999-0602fa1760cc"
}
This codebase is a fork of Deno SaaSKit, we would like to thank the contributors and maintainers of the original project.
Our project maintains the same philosophy and goals of the original project, but with some modifications to fit the needs of the eser.live and the community around us.
For the user, the website should be fast, secure and have a design with clear intent. Additionally, the HTML should be well-structured and indexable by search engines. The defining metrics for these goals are:
For the developer, the codebase should minimize the steps and amount of time required to get up and running. From there, customization and extension of the web app should be simple. The characteristics of a well-written codebase also apply, such as:
This project follows Semantic Versioning. For the versions available, see the tags on this repository.
Join the #lobi
channel in eser.live Discord to ask questions, and get unblocked.
This project is licensed under the MIT License. For further details, please see the LICENSE file.
Visit my GitHub Sponsors profile at github.com/sponsors/eser