Project template for JavaScript serverless project
Problem to solve
As a JavaScript developer, in order to host, test, build and deploy my frontend and backend code, I would like to use a unified interface with all the nice features of GitLab.
Proposal
Allow the user to choose a built-in template when creating a new project that provides them with the basic project structure and configuration to have their frontend deployed to GitLab Pages and their serverless functions to AWS Lambda.
Intended users
Further details
The example project will consist of:
- single project repo for frontend and backend code
-
gitlab-ci.yml
file with configuration to:- run tests
- run build steps
- deploy frontend code to GitLab Pages
- deploy serverless functions to AWS Lambda
-
README.md
file with the documentation for:- how to get and set up AWS credential variables
- how to serve the API endpoints over a custom domain (to avoid CORS issues). e.g.
https://www.example.com/api/<env>/<function-name>
- expected function signatures
- link to the serverless documentation about extending this setup
- all the variable parts (like AWS credentials, but even the backend and frontend project paths) are to be set as environment variables in
.gitlab-ci.yml
- the AWS region will be defined in
.gitlab-ci.yml
- Test that checks for AWS keys are installed correctly
Language-specific details for example project
- The frontend will be a simple static page with a button that when clicked makes a call to the serverless function and prints out the response
- The serverless function will return a JSON object consisting our of any request parameters passed with the request
- The JavaScript will be written in accordance with the EcmaScript 2015 specification and transpiled using Webpack/Babel
- The project will be set to be compatible with NodeJS v10
Won't do now
- we won't provide any JavaScript frameworks on the frontend or backend in this template, however other templates will build on this one to include framework-specific examples.
- we won't provision a
serverless.yaml
file automatically based on some existing exported set of functions. We might do it in the future though. We create aserverless.yaml
when we create the project, and the user should extend it as they want.
What does success look like, and how can we measure that?
- A user can create a new project from the template, set their configuration variables, run the pipeline and see the frontend and backend deployed and the frontend successfully makes a call to the serverless function and receive a valid response.
- Add tracking data to Snowplow whenever a project is created from this template.
- We should create a blog post and post it to various newsletters to see how it resonates with the developer community.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.