
Node.js Web应用开发的全功能样板项目
Hackathon Starter是一个功能丰富的Node.js Web应用样板项目。它集成了多种认证方式、用户管理和API示例,简化了开发流程。该项目以简单易用为核心,同时保持通用性和可重用性,适用于黑客马拉松和各类Web应用开发。其详尽文档和完备功能使开发者能快速启动项目,将精力集中在核心业务逻辑上。项目特点包括本地认证、OAuth 2.0社交登录、用户账户管理、API集成示例等。它还提供了文件上传、CSRF保护、MVC结构等实用功能。Hackathon Starter旨在为开发者提供一个全面而灵活的起点,无论是用于快速原型开发还是作为学习资源,都能满足多样化的Web应用需求。
Hackathon StarterLive Demo: Link
Jump to What's new?
A boilerplate for Node.js web applications.
If you have attended any hackathons in the past, then you know how much time it takes to get a project started: decide on what to build, pick a programming language, pick a web framework, pick a CSS framework. A while later, you might have an initial project up on GitHub, and only then can other team members start contributing. Or how about doing something as simple as Sign in with Facebook authentication? You can spend hours on it if you are not familiar with how OAuth 2.0 works.
When I started this project, my primary focus was on simplicity and ease of use. I also tried to make it as generic and reusable as possible to cover most use cases of hackathon web apps, without being too specific. In the worst case, you can use this as a learning guide for your projects, if for example you are only interested in Sign in with Google authentication and nothing else.
“Nice! That README alone is already gold!”<br> — Adrian Le Bas
“Awesome. Simply awesome.”<br> — Steven Rueter
“I'm using it for a year now and many projects, it's an awesome boilerplate and the project is well maintained!”<br> — Kevin Granger
<h4 align="center">Modern Theme</h4>“Small world with Sahat's project. We were using his hackathon starter for our hackathon this past weekend and got some prizes. Really handy repo!”<br> — Interview candidate for one of the companies I used to work with.



MongoDB (local install OR hosted)
Command Line Tools
<img src="https://upload.wikimedia.org/wikipedia/commons/1/1b/Apple_logo_grey.svg" height="17"> Mac OS X: Xcode (or OS X 10.9+: xcode-select --install)
<img src="https://upload.wikimedia.org/wikipedia/commons/8/87/Windows_logo_-_2021.svg" height="17"> Windows: Visual Studio Code + Windows Subsystem for Linux - Ubuntu OR Visual Studio
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/9e/UbuntuCoF.svg/512px-UbuntuCoF.svg.png?20120210072525" height="17"> Ubuntu / <img src="https://upload.wikimedia.org/wikipedia/commons/3/3f/Linux_Mint_logo_without_wordmark.svg" height="17"> Linux Mint: sudo apt-get install build-essential
<img src="https://upload.wikimedia.org/wikipedia/commons/3/3f/Fedora_logo.svg" height="17"> Fedora: sudo dnf groupinstall "Development Tools"
<img src="https://en.opensuse.org/images/b/be/Logo-geeko_head.png" height="17"> OpenSUSE: sudo zypper install --type pattern devel_basis
Note: If you are new to Node or Express, you may find Node.js & Express From Scratch series helpful for learning the basics of Node and Express. Alternatively, here is another great tutorial for complete beginners - Getting Started With Node.js, Express, MongoDB.
Step 1: The easiest way to get started is to clone the repository:
# Get the latest snapshot git clone https://github.com/sahat/hackathon-starter.git myproject # Change directory cd myproject # Install NPM dependencies npm install # Then simply start your app node app.js
Note: I highly recommend installing Nodemon. It watches for any changes in your node.js app and automatically restarts the server. Once installed, instead of node app.js use nodemon app.js. It will
save you a lot of time in the long run, because you won't need to manually restart the server each time you make a small change in code. To install, run sudo npm install -g nodemon.
Step 2: Obtain API Keys and change configs if needed After completing step 1 and locally installing MongoDB, you should be able to access the application through a web browser and use local user accounts. However, certain functions like API integrations may not function correctly until you obtain specific keys from service providers. The keys provided in the project serve as placeholders, and you can retain them for features you are not currently utilizing. To incorporate the acquired keys into the application, you have two options:
export command like this: export FACEBOOK_SECRET=xxxxxx. This method is considered a better practice as it reduces the risk of accidentally including your secrets in a code repository..env.example file: Open the .env.example file and update the placeholder keys with the newly acquired ones. This method has the risk of accidental checking-in of your secrets to code repos.What to get and configure:
SMTP
reCAPTCHA
OAuth for social logins (Sign in with / Login with)
API keys for service providers in the API Examples if you are planning to use them.
MongoDB Atlas
Email address
ngrok and HTTPS
If you want to use some API that needs HTTPS to work (for example Pinterest or Facebook),
you will need to download ngrok. Start ngrok, set your BASE_URL to the forwarding address (i.e https://3ccb-1234-abcd.ngrok-free.app ), and use the forwarding address to access your application. If you are using a proxy like ngrok, you may get a CSRF mismatch error if you try to access the app at http://localhost:8080 instead of the https://...ngrok-free.app address.
After installing or downloading the standalone ngrok client you can start ngrok to intercept the data exchanged on port 8080 with ./ngrok http 8080 in Linux or ngrok http 8080 in Windows.
Step 3: Develop your application and customize the experience
Step 4: Optional - deploy to production See:
You will need to obtain appropriate credentials (Client ID, Client Secret, API Key, or Username & Password) for API and service provides which you need. See Step 2 in the Getting started section for more info.
Obtain SMTP credentials from a provider for transactional emails. Set the SMTP_USER, SMTP_PASSWORD, and SMTP_HOST environment variables accordingly. When picking the smtp host, keep in mind that the app is configured to use secure SMTP transmissions over port 465 out of the box. You have the flexibility to select any provider that suits your needs or take advantage of one of the following providers, each offering a free tier for your convenience.
| Provider | Free Tier | Website |
|---|---|---|
| SendGrid | 100 emails/day for free | https://sendgrid.com |
| SMTP2Go | 1000 emails/month for free | https://www.smtp2go.com |
| Brevo | 300 emails/day for free | https://www.brevo.com |
.env. These keys will be accessible under Settings, reCAPTCHA keys drop down if you need them again laterhttp://localhost:8080, etc)http://localhost:8080/auth/google/callback ).envhttp://localhost:8080/auth/snapchat/callback ).env.env.env.envlocalhost under App Domainshttp://localhost:8080, etc) under Site URLhttp://localhost:8080/auth/facebook/callback

免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具


最适合小白的AI自动化工作流平台
无需编码,轻松生成可复用、可变现的AI自动化工作流

大模型驱动的Excel数据处理工具
基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI论文写作指导平台
AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。


AI赋能电商视觉革命,一站式智能商拍平台
潮际好麦深耕服装行业,是国内AI试衣效果最好的软件。使用先进AIGC能力为电商卖家批量提供优质的、低成本的商拍图。合作品牌有Shein、Lazada、安踏、百丽等65个国内外头部品牌,以及国内10万+淘宝、天猫、京东等主流平台的品牌商家,为卖家节省将近85%的出图成本,提升约3倍出图效率,让品牌能够快速上架。


企业专属的AI法律顾问
iTerms是法大大集团旗下法律子品牌,基于最先进的大语言模型(LLM)、专业的法律知识库和强大的智能体架构,帮助企业扫清合规障碍,筑牢风控防线,成为您企业专属的AI法律顾问。


稳定高效的流量提升解决方案,助力品牌曝光
稳定高效的流量提升解决方案,助力品牌曝光


最新版Sora2模型免费使用,一键生成无水印视频
最新版Sora2模型免费使用,一键生成无水印视频